﻿@{
    ViewBag.Title = "管理入口 - AppSoft2.0.IO - 百签软件有限公司";
    Layout = "~/Areas/Backend/Views/Theme/Blue/Shared/_Layout.cshtml";
}
@section HeadContent{
    @Styles.Render("~/AppStyle/Iconfont")
}
@section BodyProp{ id="loginBody" class="winu-position-absolute" }

<div id="login-container" class="winu-position-absolute">
    <h1 class="system-name winu-text-align-center winu-font-family-arial">AppSoft2.0.IO</h1>
    <div class="login-input-area">
        @using (Html.BeginForm("Login", "Entry", FormMethod.Post, new { id = "login-form" }))
            {
            <div class="input-row winu-clear-both">
                <span class="textbox-ico winu-display-inline-block winu-text-align-center"><i class="iconfont icon-zhanghaoxinxi"></i></span>
                @Html.TextBox("Account", "", new
           {
               @class = "login-textbox",
               placeholder = "请输入账号",
               datatype = "s4-32",
               nullmsg = "请输入账号",
               errormsg = "账号必须是4-32位字符"
           })
            </div>
            <div class="input-row winu-clear-both">
                <span class="textbox-ico winu-display-inline-block winu-text-align-center"><i class="iconfont icon-mima"></i></span>
                @Html.Password("Password", "", new
           {
               @class = "login-textbox",
               placeholder = "请输入密码",
               datatype = "/[a-zA-Z0-9_]{4,32}/",
               nullmsg = "请输入密码",
               errormsg = "密码只支持4到32位字母，数字，下划线或组合"
           })
            </div>
            @Html.Submit("登     录", new
       {
           id = "login-submit",
           @class = "winu-clear-both"
       })
        }
    </div>
</div>
<div class="login-copy-right winu-text-align-center winu-position-absolute">
    版权所有 @Html.Href("http://www.baisoft.org", "百签软件有限公司", "百签软件有限公司", "_blank") Copyright © 2012-2016 @Html.Href("http://www.appsoft.io", "AppSoft2.0.IO", "AppSoft2.0.IO", "_blank") Inc. All Rights Reserved.
</div>
@section FootContent{
    @Scripts.Render("~/AppScript/Validform", "~/AppScript/Backend")
    <script type="text/javascript">
        // 禁止登录页面在iframe被打开
        if (self != top) { top.location = self.location; }

        // 登录验证
        $(function () {
            SubmitForm("#login-form", "#login-submit", function (data) {
                switch (data.statu) {
                    case "no_data":
                        showError(data.tip);
                        break;
                    case "no_normal":
                        showError(data.tip);
                        break;
                    case "success":
                        showSuccess(data.tip, function () {
                            window.location = "@Url.Action("Index", "Default")";
                        }, 800);
                        break;
                    default:
                        showError("很抱歉，系统异常！");
                        break;
                }
            });
        });
    </script>
}